
import http from "./http";
// @ts-ignore
import qs from "qs";

export async function loginApi(params: { username: string; password: string; }) {
  // Postman 使用 x-www-form-urlencoded
  const res= await http.post("/login", qs.stringify(params), {
    headers: { "Content-Type": "application/x-www-form-urlencoded" }
  });
  return res;
}

export async function getUserInfoApi() {
  const res = await http.post("/core/getUserInfo");
  return res;
}

export async function getUserMenusApi() {
  const res = await http.post("/core/getUserMenus");
  return res;
}
